<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="代理商重点品类采购情况" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addData()" translate>新增</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" translate translate-attr-title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" translate translate-attr-title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color">
                            <div title="导入" ng-click="importData()">
                                <i class="yb-icon ico-import-o"></i>
                            </div>
                        </div>
                        <div class="btn btn-default base-color">
                            <div translate translate-attr-title="导出">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                            <ul class="more-tool">
                                <li yb-download download-url="exportParam.allUrl" download-param="condition" download-duration="3" is-ajax="true">
                                    <i class="yb-icon ico-export-o"></i><span translate>导出全部</span> 
                                </li>
                            </ul>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')" translate-attr-title="高级搜索" translate="高级搜索more"></button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" translate translate-attr-placeholder="代理商名称" ng-model="condition.dealerName">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)" translate>搜索</span>
                    </div>
                </div>
                <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)" reset-data="reset()">
                    <div class="advance-search m-t-sm">
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>所属区域</span> ：</label>
                            <input type="text" ng-model="condition.area" class="form-control">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>重点品类</span> ：</label>
                            <input type="text" ng-model="condition.impClass" class="form-control">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>三级分类</span> ：</label>
                            <input type="text" ng-model="condition.thridClass" class="form-control">
                        </div>
                        <div class="form-group clearfix m-b-none">
                            <label class="control-label"><span translate>提报开始月份</span>：</label>
                            <input type="text" class="form-control date-picker" ng-model="condition.startDate"
                                   datepicker-popup="{{'yyyy-MM'}}" datepicker-options="{datepickerMode:'month',minMode:'month'}"
                                   ng-click="endDateShow=false;startDateShow=!startDateShow"
                                   ng-change="checkDate(condition, 'startDate', 'endDate')"
                                   is-open="startDateShow" close-text="关闭" modal-size="small" readonly>
                        </div>
                        <div class="form-group clearfix m-b-none">
                            <label class="control-label"></label>
                            <label class="control-label wave-line">~</label>
                        </div>
                        <div class="form-group clearfix m-b-none">
                            <label class="control-label"><span translate>提报结束月份</span>：</label>
                            <input type="text" class="form-control date-picker" ng-model="condition.endDate"
                                   datepicker-popup="{{'yyyy-MM'}}" datepicker-options="{datepickerMode:'month',minMode:'month'}"
                                   ng-click="startDateShow=false;endDateShow=!endDateShow"
                                   ng-change="checkDate(condition, 'startDate', 'endDate')"
                                   is-open="endDateShow" close-text="关闭" modal-size="small" readonly>
                        </div>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tbConf" col-fixed="false"
                 has-check-col="true"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tbConf.scrollWidth}}">
                            <thead>
                            <tr>
                                <th width="40" class="text-center th-check border-l-none">
                                    <div yb-check-box yb-checked="markInfo.allChecked" yb-click="selectAll(dataList)"></div>
                                </th>
                                <th ng-repeat="itemCol in tbConf.tableCol track by $index"
                                    width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tbConf.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tbConf.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index"
                                ng-class="{'row-selected': $index === markInfo.curRow}" ng-click="selectRow($index)">
                                <td width="40" class="text-center border-l-none">
                                    <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item, dataList)"></div>
                                </td>
                                <td class="spill-dots" ng-repeat="itemCol in tbConf.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <div class="font-0" ng-if="itemCol.type == 'operate'">
                                        <button type="button" class="btn btn-operate m-r-xs" ng-click="editData(item)">编辑</button>
                                        <button type="button" class="btn btn-operate m-r-xs" ng-click="deleteData(item)">删除</button>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-check-box class="m-t-xs m-r-sm" yb-checked="markInfo.allChecked" yb-check-name="全选"
                     yb-click="selectAll(dataList)"></div>
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="{{tabFlag.name}}" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="main-area d-t-35 d-b-60">
                <form name="form" class="main-wrap form-horizontal single-col p-t clearfix" novalidate>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i><span translate>代理商</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="dealerName" class="form-control light-bg"
                                ng-model="detailInfo.dealerName" ng-click="selectDealer()" required yb-focus
                                readonly placeholder="请选择">
                        </div>
                        <div class="col-xs-4 msg-block"
                            ng-show="form.dealerName.$dirty || (form.dealerName.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.dealerName.$error.required && !form.dealerName.focused">
                                <i class="yb-icon ico-times-circular"></i>必填项，请填写
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i><span translate>所属区域</span>：</label>
                        <div class="col-xs-5 control-label" style="text-align: left;">{{detailInfo.area||'-'}}</div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i><span translate>重点品类</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="serviceRep" class="form-control" ng-model="detailInfo.impClass"
                                   required maxlength="20">
                        </div>
                        <div class="col-xs-4 msg-block"
                             ng-show="form.serviceRep.$dirty || (form.serviceRep.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.serviceRep.$error.required && !form.serviceRep.focused">
                                <i class="yb-icon ico-times-circular"></i><span translate>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i><span translate>三级分类</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="serviceRep" class="form-control" ng-model="detailInfo.thridClass"
                                   required maxlength="20">
                        </div>
                        <div class="col-xs-4 msg-block"
                             ng-show="form.serviceRep.$dirty || (form.serviceRep.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.serviceRep.$error.required && !form.serviceRep.focused">
                                <i class="yb-icon ico-times-circular"></i><span translate>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i><span translate>提报月份</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" class="form-control date-picker" ng-model="detailInfo.saleDate"
                               datepicker-popup="{{'yyyy-MM'}}" datepicker-options="{datepickerMode:'month',minMode:'month'}" name="saleDate"
                               ng-click="saleDateShow=!saleDateShow"
                               is-open="saleDateShow" close-text="关闭" modal-size="small" readonly required>
                        </div>
                        <div class="col-xs-4 msg-block"
                            ng-show="form.saleDate.$dirty || (form.saleDate.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.saleDate.$error.required && !form.saleDate.focused">
                                <i class="yb-icon ico-times-circular"></i>必填项，请填写
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i><span translate>任务数</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="taskNum" class="form-control" ng-model="detailInfo.taskNum"
                                yb-number-input disable-decimal="false" decimal-places="3" max="999999999.999" required>
                        </div>
                        <div class="col-xs-4 msg-block"
                             ng-show="form.taskNum.$dirty || (form.taskNum.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.taskNum.$error.required && !form.taskNum.focused">
                                <i class="yb-icon ico-times-circular"></i><span translate>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group save-bar m-b-none">
                        <label class="col-xs-2 control-label"></label>
                        <div class="col-xs-5 wrapper-none">
                            <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid)" translate>
                                保存
                            </button>
                            <button type="button" class="btn btn-default" ng-click="changeTab(0)" translate>取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>